package com.zut.blocks.base.common.page;

import lombok.Data;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

/**
 * @author lxd
 * @date 2020/12/6 21:46
 */
@Data
public class Page {
    int size = 15;
    int page = 0;

    public Pageable pageable(boolean sort) {
        return !sort ? PageRequest.of(page, size, Sort.by("id").descending()) : PageRequest.of(page, size);
    }


}
